﻿''' <summary>
''' 
''' </summary>
''' <remarks></remarks>
Public Class listeChampsSortieTableIntegrationTauxMort
    Inherits baseListeChampsSortieTable

    Protected nomAgeAnEntier As String = "AGE_AN"
    Protected descAgeAnEntier As String = "Age en années"
    Protected nomAgeAnExact As String = "AGE_AN_EX"
    Protected descAgeAnExact As String = "Age exact en années"

    Protected nomAgeSousAnEntier As String = "AGE_SOUS_AN"
    Protected descAgeSousAnEntier As String = "Age à la souscription en années"
    Protected nomAgeSousAnExact As String = "AGE_SOUS_AN_EX"
    Protected descAgeSousAnExact As String = "Age exact à la souscription en années"

    Protected nomTxMortAn As String = "TX_MORT_AN"
    Protected descTxMortAn As String = "Taux de mortalité annuel"

    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Private Function verifContraintesTxMort(ByVal tableBDDrattachement As tableBDD) As Boolean
        Dim result As Boolean = True
        Dim listeChampsObligEntree As String() = New String() {nomAgeAnEntier, nomTxMortAn}
        For Each nomChamps As String In listeChampsObligEntree
            If Not tableBDDrattachement.ListeChampsEntree.ContainsKey(nomChamps) Then
                result = False
            End If
        Next
        Return result
    End Function

    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Public Overrides Function initialise(ByVal sender As Object) As Boolean
        Add(descAgeAnEntier, New Correspondance(sender, _
                                                descAgeAnEntier, _
                                                New ChampsBDD(nomAgeAnEntier, _
                                                              New FormatChamps(GetType(Double))), _
                                                              typeChEntreeMapping.TABLE))
        Add(descTxMortAn, New Correspondance(sender, _
                                                 descTxMortAn, _
                                                 New ChampsBDD(nomTxMortAn, _
                                                               New FormatChamps(GetType(Double))), _
                                                 typeChEntreeMapping.TABLE))
        _initHasBeenMade = True
        AddHandler CType(sender, tableBDD).NomTableDansBDDChanged, AddressOf onTraitement_NomTableChanged
        Return _initHasBeenMade
    End Function

    Protected Overridable Sub onTraitement_NomTableChanged(ByVal sender As Object, ByVal e As EventArgs)
        Dim traitementTableBDD As tableBDD = DirectCast(sender, tableBDD)
        If verifContraintesTxMort(traitementTableBDD) Then
        End If
    End Sub

End Class
